# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=py3-whatthepatch
pkgver=1.0.5
pkgrel=1
pkgdesc="library for parsing and applying patch files"
url="https://github.com/cscorley/whatthepatch"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cscorley/whatthepatch/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/whatthepatch-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m installer -d testenv .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
d5747db9ac78993aa08cef79e3857eb90706e3f2f9fcfd34788691d3039e2846481a78faf0d6bbeaa2e8b97ff3c198f0568038224dead3af0b6bd11805d91992  py3-whatthepatch-1.0.5.tar.gz
"
